package cn.com.tarotframework.server.oauth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;

/**
 * copyright (C), 2022, 塔罗牌基础架构
 *
 * @program: tarot-demo
 * @description: 用户传参实体类
 * @author: Jiang Xincan
 * @date: 2022/5/25 17:43
 * @version: 0.0.1
 **/
@Schema(name = "用户信息传参DTO", description = "用户信息[ID, email]")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 2353075038114695602L;

    @Schema(name = "id", description = "用户ID（UUID）", type = "string", defaultValue = "1285759156342562818")
    private String id;

    @Schema(name = "email", description = "用户邮箱", type = "String", defaultValue = "tarot@163.com")
    @NotNull(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @Size(message = "邮箱长度在{min}~{max}之间", min = 5, max = 20)
    private String email;

}
